#include "codex.h"


typedef unsigned int ActorId; 

struct EvtData_Destroy_Actor : public codex::BaseEventArgs { 

	static const codex::EventType sk_EventType; 

	virtual const codex::EventType & GetEventType(void) const { 
		return sk_EventType; 
	}

	explicit EvtData_Destroy_Actor(ActorId id) : m_id(id) { } 
	explicit EvtData_Destroy_Actor(ActorId & in)
	{ 
		in = m_id; 
	} 

	virtual ~EvtData_Destroy_Actor() {} 

	tString* ToString() const
	{
		return new tString("Ohola");
	}
	
	ActorId m_id; 
}; 



class OnMemoryWarning : public codex::IEventListener 
{
public: 
	OnMemoryWarning(){}
	
	~OnMemoryWarning(){}

	char const * GetName(void) { 
		return "OnMemoryWarning";
	}; 

	tBOOL HandleEvent(codex::IEventData const & e);

};

tBOOL listenerAfuera(codex::IEventData const& e);


class Object
{
public:
	Object();
	~Object(){}
	tBOOL Touch(codex::IEventData const& event );
	const char* name;
private:
	codex::EventListenerPtr m_listener;
};


class createWindow : public codex::IApplication
{
public:
	createWindow(){}
	void			init(void); // OnInit
	void			update(tFLOAT dt); // OnEnterFrame
	void			finish(void); // OnFinish
	tBOOL			listener( codex::IEventData const& e);
	Object			*m_pObject;
	//codex::EventListenerPtr 
	//codex::EventListenerList listenersList;
	//OnMemoryWarning m_listenerMemoryWarning;

};